Recordemos que una v.a. bidimensional continua cuando su conjunto de valores en \(\mathbb{R}^2\), \((X,Y)(\Omega)\) es un producto de intervalos.
La función de distribución acumulada conjunto o simplemente distribución conjunta se define como
\[F_{XY}(x,y)=P(X\leq x,Y\leq y).\]
Sea \(f_{XY}: \mathbb{R}\times \mathbb{R}\mapsto [0,+\infty)\) diremos que es una densidad bidimensional del vector aleatorio bidimensional \((X,Y)\) si
\[F_{XY}(x,y)=\int_{-\infty}^{x}\int_{-\infty}^{y} f_{XY}(t_x,t_y) dt_xdt_y.\]
Llamaremos dominio de la variable conjunta a \[D_{XY}=\{(x,y)\in \mathbb{R}^2 | f_{XY}(x,y)>0\}.\]
Es decir es el conjunto de valores posibles que toma la v.a. \((X,Y)\).
## Gráfica
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.2 v purrr 0.3.4 ## v tibble 3.0.4 v dplyr 1.0.2 ## v tidyr 1.1.2 v stringr 1.4.0 ## v readr 1.4.0 v forcats 0.5.0
## -- Conflicts ------------------------------------------ tidyverse_conflicts() -- ## x dplyr::filter() masks stats::filter() ## x dplyr::lag() masks stats::lag()
library(plotly)
## ## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2': ## ## last_plot
## The following object is masked from 'package:stats': ## ## filter
## The following object is masked from 'package:graphics': ## ## layout
f = nbvpdf (0, 0, 1, 1, 0.5)
seq=seq(-4,4,0.01)
n=length(seq)
x=rep(seq(-4,4,0.01),times=n)
y=rep(seq(-4,4,0.01),each=n)
z=matrix(f(x,y),ncol=n)
df_list=list(x=seq,y=seq,z=z)
# volcano is a numeric matrix that ships with R
fig <- plot_ly(x=df_list$x,y=df_list$y,z=df_list$z) %>% add_surface(
contours = list(
z = list(
show=TRUE,
usecolormap=TRUE,
highlightcolor="#ff0000",
project=list(z=TRUE)
)
)
)
fig <- fig %>% layout(
scene = list(
camera=list(
eye = list(x=1.87, y=0.88, z=-0.64)
)
)
)
fig